package cn.kwq.project_manger.common;

import java.util.HashMap;
import java.util.Map;

public class R {

    public static RES okm(String key,Object value) {
        Map map=new HashMap<>();
        map.put(key,value);
        return RES
                .builder()
                .code(200)
                .data(map)
                .build();
    }

    public static RES ok(int code,String msg,Object data) {
        return RES
                .builder()
                .code(code)
                .msg(msg)
                .data(data)
                .build();
    }
    public static RES ok(String msg,Object data) {
        return RES
                .builder()
                .code(200)
                .msg(msg)
                .data(data)
                .build();
    }
    public static RES ok(int code,String msg) {
        return RES
                .builder()
                .code(code)
                .msg(msg)
                .build();
    }
    public static RES ok(String msg) {
        return RES
                .builder()
                .code(200)
                .msg(msg)
                .build();
    }
    public static RES ok(Object data) {
        return RES
                .builder()
                .code(200)
                .data(data)
                .build();
    }
    public static RES err(int code,String msg) {
        return RES
                .builder()
                .code(code)
                .msg(msg)
                .build();
    }
    public static RES err(int code,String msg,Object data) {
        return RES
                .builder()
                .code(code)
                .msg(msg)
                .data(data)
                .build();
    }
}
